Optimal. Leaf size=85 \[ \frac {2 i a^3 \tan (c+d x)}{d}-\frac {4 a^3 \log (\cos (c+d x))}{d}-4 i a^3 x+\frac {a (a+i a \tan (c+d x))^2}{2 d}+\frac {(a+i a \tan (c+d x))^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {3527, 3478, 3477, 3475} \[ \frac {2 i a^3 \tan (c+d x)}{d}-\frac {4 a^3 \log (\cos (c+d x))}{d}-4 i a^3 x+\frac {a (a+i a \tan (c+d x))^2}{2 d}+\frac {(a+i a \tan (c+d x))^3}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3475
Rule 3477
Rule 3478
Rule 3527
Rubi steps
\begin {align*} \int \tan (c+d x) (a+i a \tan (c+d x))^3 \, dx &=\frac {(a+i a \tan (c+d x))^3}{3 d}-i \int (a+i a \tan (c+d x))^3 \, dx\\ &=\frac {a (a+i a \tan (c+d x))^2}{2 d}+\frac {(a+i a \tan (c+d x))^3}{3 d}-(2 i a) \int (a+i a \tan (c+d x))^2 \, dx\\ &=-4 i a^3 x+\frac {2 i a^3 \tan (c+d x)}{d}+\frac {a (a+i a \tan (c+d x))^2}{2 d}+\frac {(a+i a \tan (c+d x))^3}{3 d}+\left (4 a^3\right ) \int \tan (c+d x) \, dx\\ &=-4 i a^3 x-\frac {4 a^3 \log (\cos (c+d x))}{d}+\frac {2 i a^3 \tan (c+d x)}{d}+\frac {a (a+i a \tan (c+d x))^2}{2 d}+\frac {(a+i a \tan (c+d x))^3}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 1.21, size = 178, normalized size = 2.09 \[ -\frac {i a^3 \sec (c) \sec ^3(c+d x) \left (15 \sin (2 c+d x)-13 \sin (2 c+3 d x)+6 d x \cos (2 c+3 d x)+6 d x \cos (4 c+3 d x)-3 i \cos (2 c+3 d x) \log \left (\cos ^2(c+d x)\right )+9 \cos (d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x-i\right )+9 \cos (2 c+d x) \left (-i \log \left (\cos ^2(c+d x)\right )+2 d x-i\right )-3 i \cos (4 c+3 d x) \log \left (\cos ^2(c+d x)\right )-24 \sin (d x)\right )}{12 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.42, size = 134, normalized size = 1.58 \[ -\frac {2 \, {\left (24 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 13 \, a^{3} + 6 \, {\left (a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + a^{3}\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )\right )}}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 0.75, size = 170, normalized size = 2.00 \[ -\frac {2 \, {\left (6 \, a^{3} e^{\left (6 i \, d x + 6 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 18 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 18 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 24 \, a^{3} e^{\left (4 i \, d x + 4 i \, c\right )} + 33 \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + 6 \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right ) + 13 \, a^{3}\right )}}{3 \, {\left (d e^{\left (6 i \, d x + 6 i \, c\right )} + 3 \, d e^{\left (4 i \, d x + 4 i \, c\right )} + 3 \, d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.02, size = 85, normalized size = 1.00 \[ \frac {4 i a^{3} \tan \left (d x +c \right )}{d}-\frac {i a^{3} \left (\tan ^{3}\left (d x +c \right )\right )}{3 d}-\frac {3 a^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {2 a^{3} \ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{d}-\frac {4 i a^{3} \arctan \left (\tan \left (d x +c \right )\right )}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.58, size = 69, normalized size = 0.81 \[ -\frac {2 i \, a^{3} \tan \left (d x + c\right )^{3} + 9 \, a^{3} \tan \left (d x + c\right )^{2} + 24 i \, {\left (d x + c\right )} a^{3} - 12 \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - 24 i \, a^{3} \tan \left (d x + c\right )}{6 \, d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 3.73, size = 59, normalized size = 0.69 \[ \frac {4\,a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )+a^3\,\mathrm {tan}\left (c+d\,x\right )\,4{}\mathrm {i}-\frac {3\,a^3\,{\mathrm {tan}\left (c+d\,x\right )}^2}{2}-\frac {a^3\,{\mathrm {tan}\left (c+d\,x\right )}^3\,1{}\mathrm {i}}{3}}{d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 0.42, size = 143, normalized size = 1.68 \[ - \frac {4 a^{3} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \frac {- 48 i a^{3} e^{4 i c} e^{4 i d x} - 66 i a^{3} e^{2 i c} e^{2 i d x} - 26 i a^{3}}{3 i d e^{6 i c} e^{6 i d x} + 9 i d e^{4 i c} e^{4 i d x} + 9 i d e^{2 i c} e^{2 i d x} + 3 i d} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________